<template>
	<view class="content container">
		<view class="list">
			<view class="list-item" v-for="(row,k) of list" :key="k">
				<view>{{row.bank_info || '银行卡'}}</view>
				<view>{{row.bank_number}}</view>
			</view>
		</view>
		<button @click="go('/pages/bankcard/bindcard')"><image class="img" src="../../static/img/my/card_plus.png"></image>添加银行卡</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		created() {
			this.$http.get('user/getUserBankList').then(res => {
				if (res.code == 1) {
					this.list = res.data.list.map(({id, bank_info, bank_number}) => {
						bank_number = bank_number.substr(0, 5) +  '****' + bank_number.substr(-5) 
						return {
							id, 
							bank_info,
							bank_number
						}
					})
				}
			})
		},
		methods: {
			
		}
	}
</script>

<style lang="scss" scoped>
.content.container {
	overflow: hidden;
	height: 100vh;
	background: #f7f7f7;
	
	
	.list {
		margin: 40rpx;
		.list-item {
			border-radius: 20rpx;
			background: #fff;
			margin-bottom: 40rpx;
			padding: 40rpx;
			
			> view {
				font-size: 28rpx;
				line-height: 1.35;
				&:first-child {
					margin-bottom: 16rpx;
				}
			}
			
		}
	}
	
	button {
		font-size: 28rpx;
		color: #016afa;
		margin: 0 40rpx;
		height: 80rpx;
		border: dashed 1px currentColor;
		border-radius: 10rpx;
		background: rgba(0,0,0,0);
		
		display: flex;
		align-items: center;
		justify-content: center;
		
		.img {
			width: 36rpx;
			height: 36rpx;
			margin-right: 8rpx;
		}
		&::after {
			display: none;
		}
	}
}
</style>
